/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package heizung.tinkerforge;
import com.tinkerforge.BrickMaster;
import com.tinkerforge.IPConnection;

/**
 *
 * @author Rene
 * @version 0.0.1
 */
public class HeizungTinkerforge {
    private static final String host = "localhost";
    private static final int port = 4223;
    private static final String UID = "";
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {
        // Master Brick verbinden
        IPConnection ipcon = new IPConnection(); // Create IP connection
        BrickMaster master = new BrickMaster(UID, ipcon); // Create device object
        
        //Verbindung initialisieren
        ipcon.connect(host, port);
        
        int voltage = master.getStackVoltage();
        int current = master.getStackCurrent();

        System.out.println("Stack Voltage: " + voltage/1000.0 + " V");
        System.out.println("Stack Current: " + current/1000.0 + " A");

        System.console().readLine("Press key to exit\n");
        ipcon.disconnect();
    }
}
